home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWResour / Include / SLResour.idl < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.5 KB  |  118 lines  |  [TEXT/MPS ]

  1. //
  2. //
  3. //    File:                SLResour.idl
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //
  9.  
  10. #ifndef SLRESOUR_IDL
  11. #define SLRESOUR_IDL
  12.  
  13. #ifndef SLSTDDEF_IDL
  14. #include "SLStdDef.idl"
  15. #endif
  16.  
  17. #ifndef SLREFCNT_IDL
  18. #include "SLRefCnt.idl"
  19. #endif
  20.  
  21.  
  22. //==============================================================================
  23. // Classes defined in this interface
  24. //==============================================================================
  25.  
  26. interface  FW_OResource;
  27.  
  28. #if defined(__SOMIDL__)
  29. #pragma somemittypes on
  30. #endif
  31.  
  32. #if defined FW_BUILD_MAC
  33. typedef short                FW_ResourceFileID;
  34. typedef FW_PlatformHandle    FW_ResourceHandle;
  35. #elif defined FW_BUILD_WIN
  36. typedef HINSTANCE            FW_ResourceFileID;
  37. typedef HRSRC                FW_ResourceHandle;
  38. #endif
  39.  
  40. #if defined(__SOMIDL__)
  41. #pragma somemittypes off
  42. #endif
  43.  
  44. interface shutUpAboutTheCommentAlready;
  45.  
  46. //==============================================================================
  47. // Types used by this interface
  48. //==============================================================================
  49.  
  50. interface  FW_OResourceFile;
  51. typedef somToken FW_CPrivResourceRep;
  52.  
  53. //========================================================================================
  54. //    FW_OResource
  55. //
  56. //    Class holding representation for resources.
  57. //========================================================================================
  58.  
  59. interface FW_OResource : FW_ORefCount
  60. {
  61.     void InitFromFile(in FW_OResourceFile file,
  62.                       in FW_ResourceId resourceId,
  63.                       in FW_ResourceType resourceType);
  64.         // Acquires the resource handle
  65.                  
  66.     void* AcquireData();
  67.         // Lock the resource and return a pointer to the data.
  68.         // Client assumes responsiblity to call ReleaseData.
  69.         
  70.     void ReleaseData();
  71.         // Unlock the resource.
  72.  
  73.     unsigned long GetSize();
  74.         // Return the size of this resource in bytes.
  75.                            
  76.     FW_ResourceHandle GetResourceHandle();
  77.         // Return the platform (native) handle.
  78.         // This method should be used with caution, since it reveals platform specifics,
  79.         // and allows violation of internal lock counts, etc.
  80.  
  81. #ifdef __SOMIDL__
  82. implementation
  83.     {
  84.         functionprefix = FW_OResource__;
  85.         
  86.         override:
  87.             somInit,
  88.             somUninit;
  89.             
  90.         releaseorder:
  91.             somInit,
  92.             somUninit,
  93.  
  94.             InitFromFile,
  95.             AcquireData,
  96.             ReleaseData,
  97.             GetSize,
  98.             GetResourceHandle;
  99.  
  100.         majorversion = 1;
  101.         minorversion = 0;
  102.  
  103.         passthru C_xh =
  104.             "";
  105.  
  106.         passthru C_xih =
  107.             "";
  108.  
  109. #ifdef __PRIVATE__
  110.         FW_CPrivResourceRep *fRep;
  111. #endif
  112.   };
  113. #endif //# __SOMIDL__
  114. };
  115.  
  116.  
  117. #endif
  118.